{volist name="data" id="vo" key="key"}
{if in_array($vo['name'], ['admin_lang','index_lang','content_lang']) /}
<div class="form-group row keyvalue">
    <script type="text/html" class="keyvalue-template">
        <div class="row pt-2">
            <div class="col-sm-4">
                <input type="text" value="" data-name="keyvalue-key" {:extend_options(['class'=>'form-control', 'placeholder'=>$vo['tips'], 'data-rule'=>str_replace(',',';',$vo['rules']), 'data-msg'=>$vo['error_tips']], $vo['extend'], true)}>
            </div>
            <div class="col-sm-4">
                <input type="text" value="" data-name="keyvalue-value" {:extend_options(['class'=>'form-control', 'placeholder'=>$vo['tips'], 'data-rule'=>str_replace(',',';',$vo['rules']), 'data-msg'=>$vo['error_tips']], $vo['extend'], true)}>
            </div>
            <div class="col-sm-2 d-flex align-items-center">
                <label class="m-0"><input type="radio" value="1" name="row[{$vo['name']}]"> {:lang('Default')}</label>
            </div>
            <div class="col-sm-2 d-flex align-items-center">
                <a href="#" class="btn btn-default btn-xs btn-keyvalue-row-del" title="删除"><i class="fas fa-times"></i></a>
                <a href="javascript:;" class="btn btn-default btn-xs  ml-1" title="拖动进行排序"><i class="fas fa-arrows-alt"></i></a>
            </div>
        </div>
    </script>

    <label class="col-sm-2 col-12 row-form-label">{if $vo['name']=='admin_lang'}{:lang('Backend interface language')}{elseif($vo['name']=='content_lang') }{:lang('Content language list')}{else /}{:lang('Frontend interface language')}{/if}：</label>
    <div class="col-sm-6 col-12" style="padding-top: calc(.375rem + 1px);padding-bottom: calc(.375rem + 1px);">
        <div class="row">
            <div class="col-sm-4">{:lang('Language')}</div>
            <div class="col-sm-4">{:lang('Title')}</div>
            <div class="col-sm-4">{:lang('Default')}</div>
        </div>

        <textarea name="row[{$vo['name']}_data_list]" class="key-value-textarea d-none">{$vo['value']}</textarea>

        <div class="keyvalue-item">
            {volist name="vo['value_array']" id="item"}
            <div class="row pt-2">
                <div class="col-sm-4">
                    {if $vo['name']=='content_lang'}
                    <input type="text" value="{$key}" name="lankey[{$key}]" data-name="keyvalue-key" {:extend_options(['class'=>'form-control', 'placeholder'=>$vo['tips'], 'data-rule'=>str_replace(',',';',$vo['rules']), 'data-msg'=>$vo['error_tips']], $vo['extend'], true)}>
                    {else /}
                    <input type="text" value="{$key}" name="keyvalue{$i}" data-name="keyvalue-key" {:extend_options(['class'=>'form-control', 'placeholder'=>$vo['tips'], 'data-rule'=>str_replace(',',';',$vo['rules']), 'data-msg'=>$vo['error_tips']], $vo['extend'], true)}>
                    {/if}
                </div>
                <div class="col-sm-4">
                    <input type="text" value="{$item}" name="keyvalue{$i}" data-name="keyvalue-value" {:extend_options(['class'=>'form-control', 'placeholder'=>$vo['tips'], 'data-rule'=>str_replace(',',';',$vo['rules']), 'data-msg'=>$vo['error_tips']], $vo['extend'], true)}>
                </div>
                <div class="col-sm-2 d-flex align-items-center">
                    <label class="m-0"><input type="radio" value="{$key}" name="row[{$vo['name']}]" {if $vo['value']==$key}checked{/if}> {:lang('Default')}</label>
                </div>
                <div class="col-sm-2 d-flex align-items-center">
                    <a href="#" class="btn btn-default btn-xs btn-keyvalue-row-del" title="删除"><i class="fas fa-times"></i></a>
                    <a href="javascript:;" class="btn btn-default btn-xs  ml-1" title="拖动进行排序"><i class="fas fa-arrows-alt"></i></a>
                </div>
            </div>
            {/volist}
        </div>

        <div class="row pt-3">
            <div class="col-sm-12">
                <a href="#" class="btn btn-sm btn-default btn-keyvalue-row-add"><i class="fas fa-plus"></i> {:lang('Append')}</a>
            </div>
        </div>
    </div>
    <div class="col-sm-1 form-tips">{if !empty($vo['tips'])}<span class="form-tips-span text-md" data-tips="{$vo['tips']}"><i class="fa fa-info-circle"></i></span>{/if}</div>
    <div class="col-sm-2 d-flex align-items-center">
        {if $vo['name']=='index_lang'}
        <button class="btn btn-default btn-sm hk-btn-showTags" data-title="{:lang('Label call')}" data-type="lang" type="button">
            {:lang('Label call')}
        </button>
        {/if}
        {if $vo['name']=='content_lang'}
        <a href="https://www.kancloud.cn/hkcms/hkcms_tp6/2555617" class="text-primary" target="_blank">{:lang('Help')}</a>
        {/if}
    </div>
    {if $vo['is_default']==0}
    <div class="col-sm-1 d-flex align-items-center">
        <button type="button" class="btn btn-danger btn-xs btn-row-del" data-id="{$vo.id}" title="{:lang('Delete')}"><i class="fas fa-trash-alt"></i></button>
    </div>
    {/if}
</div>
{/if}
{/volist}